﻿using System.Collections;
using System.Collections.Generic;

namespace BaseSyntax.GenericTest.AnimalBase
{
	public class Farm<T>:IEnumerable<T> where T:Animal
	{
		private List<T> animals = new List<T>();

		public void Add(T animal)
		{
			animals.Add(animal);
		}
		
		public IEnumerator<T> GetEnumerator()
		{
			return animals.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return animals.GetEnumerator();
		}
	}
}